set more off

******************************************************************************************************************************
**********************************Figure 3, Table S.4, Table S.5***************************************************
******************************************************************************************************************************

*bootstrap for confidence intervals

local rloop = 250

local N = 54648

local loopcount = 0

local J = 10


forvalues r = 1/`rloop' {


local loopcount = `loopcount'+1
display "LOOP START!"
display "LOOP START!"
display "LOOP START!"
display "LOOP START!"
display "r is `r'"

set seed 600`r'

do programs/flexiblelogit_bootstrap.do `J'  `N' 

gen r = `r'
if(`loopcount' > 1) append using bootstrap.dta

save bootstrap.dta, replace
}










